using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Kitware.mummy.Runtime;

namespace Kitware.VTK;

/// <summary>
///    vtkDijkstraImageGeodesicPath
/// </summary>
/// <remarks>
///    Dijkstra algorithm to compute the graph geodesic.
///
/// Takes as input a polyline and an image representing a 2D cost function
/// and performs a single source shortest path calculation.
/// Dijkstra's algorithm is used. The implementation is
/// similar to the one described in Introduction to Algorithms (Second Edition)
/// by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and
/// Cliff Stein, published by MIT Press and McGraw-Hill. Some minor
/// enhancement are added though. All vertices are not pushed on the heap
/// at start, instead a front set is maintained. The heap is implemented as
/// a binary heap. The output of the filter is a set of lines describing
/// the shortest path from StartVertex to EndVertex.  See parent class
/// vtkDijkstraGraphGeodesicPath for the implementation.
///
/// @warning
/// The input cost image must have only VTK_PIXEL cells: i.e., a 2D image or
/// slice of a 3D volume. A cost function for a gray scale image might
/// be generated by the following pipeline:
/// vtkImageData-&gt;vtkImageGradientMagnitude-&gt;vtkImageShiftScale
/// wherein the gradient magnitude image is inverted so that strong edges
/// have low cost value.  Costs in moving from a vertex v to a vertex u
/// are calculated using a weighted additive scheme:
/// cost = Iw*f(I) + Ew*f(u,v) + Cw*f(t,u,v)
/// where Iw is the weight associated with f(I): the normalized image cost,
/// Ew is the weight associated with f(u,v): the normalized distance between
/// vertices u and v, and Cw is the weight associated with f(t,u,v):
/// the normalized curvature calculated from the vertex t which precedes
/// vertex u, and vertices u and v.  All weights range from 0 to 1.
///
/// @par Thanks:
/// The class was contributed by Dean Inglis.
/// </remarks>
public class vtkDijkstraImageGeodesicPath : vtkDijkstraGraphGeodesicPath
{
	/// <summary>
	/// Automatically generated type registration mechanics.
	/// </summary>
	public new const string MRFullTypeName = "Kitware.VTK.vtkDijkstraImageGeodesicPath";

	/// <summary>
	/// Automatically generated type registration mechanics.
	/// </summary>
	public new static readonly string MRClassNameKey;

	/// <summary>
	/// Automatically generated type registration mechanics.
	/// </summary>
	static vtkDijkstraImageGeodesicPath()
	{
		MRClassNameKey = "class vtkDijkstraImageGeodesicPath";
		Methods.RegisterType(Assembly.GetExecutingAssembly(), MRClassNameKey, Type.GetType("Kitware.VTK.vtkDijkstraImageGeodesicPath"));
	}

	/// <summary>
	/// Automatically generated constructor - called from generated code.
	/// DO NOT call directly.
	/// </summary>
	public vtkDijkstraImageGeodesicPath(IntPtr rawCppThis, bool callDisposalMethod, bool strong)
		: base(rawCppThis, callDisposalMethod, strong)
	{
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern IntPtr vtkDijkstraImageGeodesicPath_New(ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount);

	/// <summary>
	/// Instantiate the class
	/// </summary>
	public new static vtkDijkstraImageGeodesicPath New()
	{
		vtkDijkstraImageGeodesicPath result = null;
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr intPtr = vtkDijkstraImageGeodesicPath_New(ref mteStatus, ref mteIndex, ref rawRefCount);
		if (IntPtr.Zero != intPtr)
		{
			result = (vtkDijkstraImageGeodesicPath)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, callDisposalMethod: true, out var _);
		}
		return result;
	}

	/// <summary>
	/// Instantiate the class
	/// </summary>
	public vtkDijkstraImageGeodesicPath()
		: base(IntPtr.Zero, callDisposalMethod: false, strong: false)
	{
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr rawCppThis = vtkDijkstraImageGeodesicPath_New(ref mteStatus, ref mteIndex, ref rawRefCount);
		SetCppThis(rawCppThis, callDisposalMethod: true, (mteStatus != 0 && rawRefCount >= 2) ? true : false);
	}

	/// <summary>
	/// Automatically generated protected Dispose method - called from
	/// public Dispose or the C# destructor. DO NOT call directly.
	/// </summary>
	protected override void Dispose(bool disposing)
	{
		base.Dispose(disposing);
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern double vtkDijkstraImageGeodesicPath_GetCurvatureWeight_01(HandleRef pThis);

	/// <summary>
	/// Curvature cost weight.
	/// </summary>
	public virtual double GetCurvatureWeight()
	{
		return vtkDijkstraImageGeodesicPath_GetCurvatureWeight_01(GetCppThis());
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern double vtkDijkstraImageGeodesicPath_GetCurvatureWeightMaxValue_02(HandleRef pThis);

	/// <summary>
	/// Curvature cost weight.
	/// </summary>
	public virtual double GetCurvatureWeightMaxValue()
	{
		return vtkDijkstraImageGeodesicPath_GetCurvatureWeightMaxValue_02(GetCppThis());
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern double vtkDijkstraImageGeodesicPath_GetCurvatureWeightMinValue_03(HandleRef pThis);

	/// <summary>
	/// Curvature cost weight.
	/// </summary>
	public virtual double GetCurvatureWeightMinValue()
	{
		return vtkDijkstraImageGeodesicPath_GetCurvatureWeightMinValue_03(GetCppThis());
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern double vtkDijkstraImageGeodesicPath_GetEdgeLengthWeight_04(HandleRef pThis);

	/// <summary>
	/// Edge length cost weight.
	/// </summary>
	public virtual double GetEdgeLengthWeight()
	{
		return vtkDijkstraImageGeodesicPath_GetEdgeLengthWeight_04(GetCppThis());
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern double vtkDijkstraImageGeodesicPath_GetImageWeight_05(HandleRef pThis);

	/// <summary>
	/// Image cost weight.
	/// </summary>
	public virtual double GetImageWeight()
	{
		return vtkDijkstraImageGeodesicPath_GetImageWeight_05(GetCppThis());
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern IntPtr vtkDijkstraImageGeodesicPath_GetInputAsImageData_06(HandleRef pThis, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount);

	/// <summary>
	/// Specify the image object which is used as a cost function.
	/// </summary>
	public vtkImageData GetInputAsImageData()
	{
		vtkImageData vtkImageData2 = null;
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr intPtr = vtkDijkstraImageGeodesicPath_GetInputAsImageData_06(GetCppThis(), ref mteStatus, ref mteIndex, ref rawRefCount);
		if (IntPtr.Zero != intPtr)
		{
			vtkImageData2 = (vtkImageData)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, callDisposalMethod: true, out var found);
			if (found)
			{
				vtkImageData2.Register(null);
			}
		}
		return vtkImageData2;
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern long vtkDijkstraImageGeodesicPath_GetNumberOfGenerationsFromBase_07(HandleRef pThis, string type);

	/// <summary>
	/// Standard methods for printing and determining type information.
	/// </summary>
	public override long GetNumberOfGenerationsFromBase(string type)
	{
		return vtkDijkstraImageGeodesicPath_GetNumberOfGenerationsFromBase_07(GetCppThis(), type);
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern long vtkDijkstraImageGeodesicPath_GetNumberOfGenerationsFromBaseType_08(string type);

	/// <summary>
	/// Standard methods for printing and determining type information.
	/// </summary>
	public new static long GetNumberOfGenerationsFromBaseType(string type)
	{
		return vtkDijkstraImageGeodesicPath_GetNumberOfGenerationsFromBaseType_08(type);
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern int vtkDijkstraImageGeodesicPath_IsA_09(HandleRef pThis, string type);

	/// <summary>
	/// Standard methods for printing and determining type information.
	/// </summary>
	public override int IsA(string type)
	{
		return vtkDijkstraImageGeodesicPath_IsA_09(GetCppThis(), type);
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern int vtkDijkstraImageGeodesicPath_IsTypeOf_10(string type);

	/// <summary>
	/// Standard methods for printing and determining type information.
	/// </summary>
	public new static int IsTypeOf(string type)
	{
		return vtkDijkstraImageGeodesicPath_IsTypeOf_10(type);
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern IntPtr vtkDijkstraImageGeodesicPath_NewInstance_12(HandleRef pThis, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount);

	/// <summary>
	/// Standard methods for printing and determining type information.
	/// </summary>
	public new vtkDijkstraImageGeodesicPath NewInstance()
	{
		vtkDijkstraImageGeodesicPath result = null;
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr intPtr = vtkDijkstraImageGeodesicPath_NewInstance_12(GetCppThis(), ref mteStatus, ref mteIndex, ref rawRefCount);
		if (IntPtr.Zero != intPtr)
		{
			result = (vtkDijkstraImageGeodesicPath)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, callDisposalMethod: true, out var _);
		}
		return result;
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern IntPtr vtkDijkstraImageGeodesicPath_SafeDownCast_13(HandleRef o, ref uint mteStatus, ref uint mteIndex, ref uint rawRefCount);

	/// <summary>
	/// Standard methods for printing and determining type information.
	/// </summary>
	public new static vtkDijkstraImageGeodesicPath SafeDownCast(vtkObjectBase o)
	{
		vtkDijkstraImageGeodesicPath vtkDijkstraImageGeodesicPath2 = null;
		uint mteStatus = 0u;
		uint mteIndex = uint.MaxValue;
		uint rawRefCount = 0u;
		IntPtr intPtr = vtkDijkstraImageGeodesicPath_SafeDownCast_13(o?.GetCppThis() ?? default(HandleRef), ref mteStatus, ref mteIndex, ref rawRefCount);
		if (IntPtr.Zero != intPtr)
		{
			vtkDijkstraImageGeodesicPath2 = (vtkDijkstraImageGeodesicPath)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, callDisposalMethod: true, out var found);
			if (found)
			{
				vtkDijkstraImageGeodesicPath2.Register(null);
			}
		}
		return vtkDijkstraImageGeodesicPath2;
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkDijkstraImageGeodesicPath_SetCurvatureWeight_14(HandleRef pThis, double _arg);

	/// <summary>
	/// Curvature cost weight.
	/// </summary>
	public virtual void SetCurvatureWeight(double _arg)
	{
		vtkDijkstraImageGeodesicPath_SetCurvatureWeight_14(GetCppThis(), _arg);
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkDijkstraImageGeodesicPath_SetEdgeLengthWeight_15(HandleRef pThis, double arg0);

	/// <summary>
	/// Edge length cost weight.
	/// </summary>
	public void SetEdgeLengthWeight(double arg0)
	{
		vtkDijkstraImageGeodesicPath_SetEdgeLengthWeight_15(GetCppThis(), arg0);
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkDijkstraImageGeodesicPath_SetImageWeight_16(HandleRef pThis, double arg0);

	/// <summary>
	/// Image cost weight.
	/// </summary>
	public void SetImageWeight(double arg0)
	{
		vtkDijkstraImageGeodesicPath_SetImageWeight_16(GetCppThis(), arg0);
	}

	[DllImport("Kitware.VTK.FiltersModeling.Unmanaged.dll", CallingConvention = CallingConvention.Cdecl)]
	internal static extern void vtkDijkstraImageGeodesicPath_SetInputData_17(HandleRef pThis, HandleRef arg0);

	/// <summary>
	/// Specify the image object which is used as a cost function.
	/// </summary>
	public new void SetInputData(vtkDataObject arg0)
	{
		vtkDijkstraImageGeodesicPath_SetInputData_17(GetCppThis(), arg0?.GetCppThis() ?? default(HandleRef));
	}
}
